import request from "../utils/request";

/**
 * 法币对列表
 */
export function getCurrencySellList() {
  return request({
    url: "/v1/currencyFiat/getCurrencySellList",
    method: "GET",
  });
}
/**
 * 收款账号信息
 */
export function getPaymentAccount(payment_method_id) {
  return request({
    url: `/v1/currencyFiat/getPaymentAccount/${payment_method_id}`,
    method: "GET",
  });
}
/**
 * 支付方式列表（购买）
 */
export function getPaymentBuy(currency_sell_id) {
  return request({
    url: `/v1/orderFiat/buy/${currency_sell_id}/getPayment`,
    method: "GET",
  });
}
/**
 * 支付方式列表（卖出）
 */
export function getPaymentSell(currency_sell_id) {
  return request({
    url: `/v1/orderFiat/sell/${currency_sell_id}/getPayment`,
    method: "GET",
  });
}
/**
 * 发布买入广告订单-获取支付方式
 */
export function getTenantPaymentBuy(currency_sell_id) {
  return request({
    url: `/v1/legalTenantAdvertising/buy/${currency_sell_id}/getPayment`,
    method: "GET",
  });
}
/**
 * 发布卖出广告订单-获取支付方式
 */
export function getTenantPaymentSell(currency_sell_id) {
  return request({
    url: `/v1/legalTenantAdvertising/sell/${currency_sell_id}/getPayment`,
    method: "GET",
  });
}
/**
 * 法币订单购买
 */
export function orderFiatBuy(data) {
  return request({
    url: `/v1/orderFiat/buy`,
    method: "POST",
    data,
  });
}

/**
 * 购买-商户发起申诉
 */
export function orderFiatBuyAppeal(data) {
  return request({
    url: `/v1/orderFiat/buy/appeal`,
    method: "POST",
    data,
  });
}

/**
 * 购买-用户确认转账
 */
export function orderFiatBuyPayment(data) {
  return request({
    url: `/v1/orderFiat/buy/payment`,
    method: "POST",
    data,
  });
}

/**
 * 购买-商户放行订单/拒绝订单
 */
export function orderFiatBuyTenantHandle(data) {
  return request({
    url: `/v1/orderFiat/buy/handle`,
    method: "POST",
    data,
  });
}

/**
 * 购买-用户取消订单
 */
export function orderFiatBuyCancel(id) {
  return request({
    url: `/v1/orderFiat/buy/${id}/cancel`,
    method: "GET",
  });
}

/**
 * 法币订单详情
 */
export function orderFiatDetail(id) {
  return request({
    url: `/v1/orderFiat/details/${id}`,
    method: "GET",
  });
}
/**
 * 法币订单列表
 */
export function orderFiatPage(params) {
  return request({
    url: "/v1/orderFiat/page",
    method: "GET",
    params,
  });
}
/**
 * 法币订单确认转账
 */
export function orderFiatPayment(data) {
  return request({
    url: `/v1/orderFiat/payment`,
    method: "POST",
    data,
  });
}
//出售

/**
 * 法币订单出售
 */
export function orderFiatSell(data) {
  return request({
    url: `/v1/orderFiat/sell`,
    method: "POST",
    data,
  });
}

/**
 * 出售-用户发起申诉
 */
export function orderFiatSellAppeal(data) {
  return request({
    url: `/v1/orderFiat/sell/appeal`,
    method: "POST",
    data,
  });
}

/**
 * 出售-商户确认转账
 */
export function orderFiatSellPayment(data) {
  return request({
    url: `/v1/orderFiat/sell/payment`,
    method: "POST",
    data,
  });
}

/**
 * 出售-用户放行订单/拒绝订单
 */
export function orderFiatSellTenantHandle(data) {
  return request({
    url: `/v1/orderFiat/sell/handle`,
    method: "POST",
    data,
  });
}

/**
 * 出售-商户取消订单
 */
export function orderFiatSellCancel(id) {
  return request({
    url: `/v1/orderFiat/sell/${id}/cancel`,
    method: "GET",
  });
}

// 发布广告订单
/**
 * 状态变更
 */
export function legalTenantAdvertisingChangeStatus(id) {
  return request({
    url: `/v1/legalTenantAdvertising/change/${id}/status`,
    method: "GET",
  });
}

/**
 * 订单编辑
 */
export function legalTenantAdvertisingEdit(data) {
  return request({
    url: `/v1/legalTenantAdvertising/edit`,
    method: "POST",
    data,
  });
}

/**
 * 我的发布订单列表
 */
export function legalTenantAdvertisingPage(params) {
  return request({
    url: "/v1/legalTenantAdvertising/page",
    method: "GET",
    params,
  });
}

/**
 * 订单发布
 */
export function legalTenantAdvertisingPush(data) {
  return request({
    url: `/v1/legalTenantAdvertising/push`,
    method: "POST",
    data,
  });
}

/**
 * 商户名资金密码设置
 */
export function legalTenantAdvertisingSetting(data) {
  return request({
    url: `/v1/legalTenantAdvertising/setting`,
    method: "POST",
    data,
  });
}

/**
 * 删除发布订单
 */
export function legalTenantAdvertisingDelete(id) {
  return request({
    url: `/v1/legalTenantAdvertising/${id}/delete`,
    method: "DELETE",
  });
}

/**
 * 法币可用余额
 */
export function legalTenantAdvertisingGetBalance(id) {
  return request({
    url: `/v1/legalTenantAdvertising/${id}/getBalance`,
    method: "GET",
  });
}

/**
 * 提交审核
 */
export function legalTenantAuthentication(data) {
  return request({
    url: `/v1/legalTenant/authentication`,
    method: "POST",
    data,
  });
}

/**
 * 商户信息
 */
export function legalTenantDetails() {
  return request({
    url: `/v1/legalTenant/details`,
    method: "GET",
  });
}

/**
 * 提醒设置
 */
export function legalTenantRemind(data) {
  return request({
    url: `/v1/legalTenant/remind`,
    method: "POST",
    data,
  });
}

/**
 * 获取商户审核信息设置
 */
export function legalTenantSetting() {
  return request({
    url: `/v1/legalTenant/setting`,
    method: "GET",
  });
}

/**
 * 添加收款方式
 */
export function userPaymentMethodAdd(data) {
  return request({
    url: `/v1/userPaymentMethod/add`,
    method: "POST",
    data,
  });
}

/**
 * 编辑收款方式
 */
export function userPaymentMethodEdit(data) {
  return request({
    url: `/v1/userPaymentMethod/edit`,
    method: "POST",
    data,
  });
}

/**
 * 用户邮件通知设置
 */
export function userPaymentMethodEmailSetting(status) {
  return request({
    url: `/v1/userPaymentMethod/emailInform/${status}/setting`,
    method: "GET",
  });
}
/**
 * 用户手机通知设置
 */
export function userPaymentMethodPhoneSetting(status) {
  return request({
    url: `/v1/userPaymentMethod/phoneInform/${status}/setting`,
    method: "GET",
  });
}

/**
 * 收款方式列表
 */
export function userPaymentMethodGetPaymentMethod(params) {
  return request({
    url: "/v1/userPaymentMethod/getPaymentMethod",
    method: "GET",
    params,
  });
}

/**
 * 用户收款信息列表
 */
export function userPaymentMethodList() {
  return request({
    url: "/v1/userPaymentMethod/list",
    method: "GET",
  });
}

/**
 * 获取用户通知设置
 */
export function userPaymentMethodUserInformSetting() {
  return request({
    url: "/v1/userPaymentMethod/userInformSetting",
    method: "GET",
  });
}

/**
 * 用户收款方式删除
 */
export function userPaymentMethodDelete(id) {
  return request({
    url: `/v1/userPaymentMethod/${id}/delete`,
    method: "DELETE",
  });
}

/**
 * 用户收款方式状态变更
 */
export function userPaymentMethodChangeStatus(id) {
  return request({
    url: `/v1/userPaymentMethod/${id}/changeStatus`,
    method: "GET",
  });
}

/**
 * 自选专区列表
 */
export function orderFiatSelfSelectedPage(params) {
  return request({
    url: "/v1/orderFiat/selfSelectedPage",
    method: "GET",
    params,
  });
}

/**
 * 聊天列表
 * @param {*} params
 * @returns
 */
export function getOrderFiatMessage(params) {
  return request({
    url: "/v1/orderFiatMessage/messagePage",
    method: "GET",
    params,
  });
}
/**
 * 发送消息
 */
export function orderFiatMessageSend(data) {
  return request({
    url: `/v1/orderFiatMessage/send`,
    method: "POST",
    data,
  });
}
/**
 * 已读消息
 */
export function orderFiatMessageRead(id) {
  return request({
    url: `/v1/orderFiatMessage/${id}/read`,
    method: "GET",
  });
}
/**
 * 出售获取匹配商户收款方式的用户收款信息列表
 */
export function userPaymentMethodMatchList(params) {
  return request({
    url: "/v1/userPaymentMethod/match/list",
    method: "GET",
    params,
  });
}
